Apeneck Sweeney
Vector Arithmetic

Author
HP-29C / GO-25, 2019.07.30
support@BigCatOs.com

Theory
Grizzled bush pilot Apeneck Sweeney's converted Swordfish aircraft has a true air speed of 150 knots and an estimated heading of 45°. The Swordfish is also being buffeted by a headwind of 40 knots from a bearing of 25°. What is the actual ground speed and course of the Swordfish?

The course and ground speed are equal to the sum of the instrument vector (150 knots, 45°) and the wind vector (-40 knots, -25°), but since the wind vector opposes the instrument vector the result is a vector subtraction. (North becomes the x-coordinate so that the problem corresponds with navigational convention.)

The vectors are converted to rectangular coordinates and summed using the g and D keys. Using the RCL key the result of the vector arithmetic is recalled from storage registers R₇ (Σx) and R₄ (Σy) and placed in the X and Y registers. The new summed rectangular coordinates are then converted back to polar coordinates to give the vector of the actual ground speed and course, (113.24 knots, 51.94°).

Instructions
To run, enter:
e 00
,

Program Listing
01    15 74 ; NOP
02 14 11 02 ; FIX 2
03    15 32 ; DEG
04    14 33 ; CLEAR REG
05       04 ; 4
06       05 ; 5
07       31 ; ENTER
08       01 ; 1
09       05 ; 5
10       00 ; 0
11    14 09 ; ->R
12       25 ; Σ+
13       02 ; 2
14       05 ; 5
15       31 ; ENTER
16       04 ; 4
17       00 ; 0
18    14 09 ; ->R
19    14 25 ; Σ-
20    24 04 ; RCL 4
21    15 74 ; NOP
22    24 07 ; RCL 7
23    15 09 ; →P
24    14 74 ; PAUSE
25       21 ; Swap xy
26    14 74 ; PAUSE
27    15 74 ; NOP
28    13 00 ; GTO 00